package com.jd.jr.insights.dm.dim.service.impl;

import com.alibaba.fastjson.JSON;
import com.jd.jr.insights.dm.dim.dao.OperationLogDao;
import com.jd.jr.insights.dm.dim.dao.impl.OperationLogDaoImpl;
import com.jd.jr.insights.dm.dim.domain.OperationLog;
import com.jd.jr.insights.dm.dim.service.OperationLogService;
import com.jd.jr.insights.dm.dim.util.fastjson.tree.Result;
import com.jd.jr.insights.dm.dim.util.fastjson.tree.ResultCode;

/**
 * Created by Administrator on 2017/9/3.
 */
public class OperationLogServiceImpl implements OperationLogService {
    OperationLogDao operationLogDao=new OperationLogDaoImpl();
    public String getOperationLogInPage(int pageNum) {
        return JSON.toJSONString(this.operationLogDao.getListInPage(pageNum));
    }

    public String save(OperationLog operationLog) {
        if(operationLogDao.save(operationLog)==true){
            return JSON.toJSONString(new Result(ResultCode.OK));
        }
        return JSON.toJSONString(new Result(ResultCode.ERROT));
    }
}
